import request from '@/utils/request'

export function saveUser(data) {
  return request({
    url: 'sys/user/save',
    method: 'post',
    data
  })
}

export function updateUser(data) {
  return request({
    url: 'sys/user/update',
    method: 'post',
    data
  })
}

export function getUserList(data) {
  return request({
    url: 'sys/user/list',
    method: 'get',
    params: data
  })
}

export function getUserInfo(userId) {
  return request({
    url: 'sys/user/info/' + userId,
    method: 'get'
  })
}

export function deleteUser(userId) {
  return request({
    url: 'sys/user/delete',
    method: 'post',
    data: userId
  })
}

export function resetPasword(data) {
  return request({
    url: 'sys/user/resetPassword',
    method: 'post',
    data
  })
}

export function getCurrentUser() {
  return request({
    url: 'sys/user/current/info',
    method: 'get'
  })
}
export function queryLoginStates(data) {
  return request({
    url: 'sys/user/queryLoginStates',
    method: 'post',
    params: data
  })
}

export function deleteLoginStates(data) {
  return request({
    url: 'sys/user/deleteLoginStates',
    method: 'post',
    params: data
  })
}
export function queryUserByPassword(data) {
  return request({
    url: 'sys/user/queryUserByPassword',
    method: 'post',
    params: data
  })
}
